<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>

<script src="lib/vue-2.4.0.js"></script>

</head>

<body>

     <div id="app">
          <p>{{msg}}</p>
          <mycom3></mycom3>
     </div>

     <div id="app2">
               <login></login>
     </div>

     <template id="tmp1">
          <div>
               <h1>这是通过template来组件代码的方式</h1>
               
          </div>
     
     </template>
     <script>
       Vue.component('mycom3',{
            template:'#tmp1'
       })
        var vm = new Vue({
             el : '#app',
             data : {
             msg :'' 
            }
        }) 

        var vm2 = new Vue({
             el:'#app2',
             data:{},
               methods: {},
               filters:{},
               directives:{},
               components:{ // 定义实例内部私有组件
                    login:{
                         template:'<h1>safkehefh</h1>'
                    }

               },

               beforeCreate() {},
               created() {},
               beforeMount() {},
               mounted() {},
               updated() {},
               beforeDestroy() {},
               destroyed() {},
        })

     </script>

</body>

</html>